package com.koron.plan.web.statistic.rest;


import com.koron.bean.base.Response;
import com.koron.common.core.config.ThreadLocalContext;
import com.koron.plan.web.statistic.service.NanShaDataStatistic;
import org.koron.ebs.mybatis.ADOConnection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/stat")
public class StatisticController {

    @Autowired
    NanShaDataStatistic nanShaDataStatistic;

    private String getCurrDs(){
        return ThreadLocalContext.get().getCurrDs();
    }

    @GetMapping("/staOrderHandleRate")
    public Response staOrderHandleRate(String startTime, String endTime){
        return ADOConnection.runTask(getCurrDs(), nanShaDataStatistic, "staOrderHandleRate",Response.class,startTime, endTime);
    }
}
